<template>
  <img alt="Vue logo" src="./assets/logo.png" />
  <HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
  <RemoteApp />
  <RemoteButton />
  <p>
    <b>使用远程模块的 add 函数计算 1 + 1 = {{ add(1, 1) }}</b>
  </p>
</template>

<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import HelloWorld from './components/HelloWorld.vue';
import { defineAsyncComponent } from 'vue';
// 下面是导入远程模块
import RemoteApp from 'remote-app/App';
import { add } from 'remote-app/utils';

const RemoteButton = defineAsyncComponent(() => import('remote-app/Button'));
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
